<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title>管理系统</title>
    <meta name="description" content=""/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}"/>
    <link rel="stylesheet" th:href="@{/font-awesome/4.5.0/css/font-awesome.min.css}"/>
    <!--    <link rel="stylesheet" th:href="@{/css/fonts.googleapis.com.css}"/>-->
    <link rel="stylesheet" th:href="@{/css/ace.min.css}" class="ace-main-stylesheet" id="main-ace-style"/>
    <link rel="stylesheet" th:href="@{/css/ace-part2.min.css}" class="ace-main-stylesheet"/>
    <link rel="stylesheet" th:href="@{/css/ace-skins.min.css}"/>
    <link rel="stylesheet" th:href="@{/css/ace-rtl.min.css}"/>
    <link rel="stylesheet" th:href="@{/css/ace-ie.min.css}"/>
    <link rel="stylesheet" th:href="@{/css/bootstrap-fileinput.css}"/>
    <link rel="stylesheet" th:href="@{/css/bootstrap-datepicker3.min.css}"/>
    <script th:src="@{/js/ace-extra.min.js}"></script>
    <script th:src="@{/js/html5shiv.min.js}"></script>
    <script th:src="@{/js/respond.min.js}"></script>
    <style>
        .form-control {
            border: 1px solid indianred;
        }

        table tr td {
            border: 1px solid black;
        }

        .table th, .table td {
            text-align: center;
            vertical-align: middle !important;
        }

        [contenteditable="true"] {
            background-color: lightyellow;
        }

        .table_foot a {
            float: right;
            margin-left: 35px;
        }

        .input-group {
            width: 100%;
        }

    </style>
</head>
<body class="no-skin">
<!--头导航栏-->
<div th:replace="common/bar::#navbar"></div>
<div class="main-container ace-save-state" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.loadState('main-container')
        } catch (e) {
        }
    </script>
    <!-- 侧导航栏 -->
    <div th:replace="common/bar::#sidebar"></div>

    <div class="main-content">
        <div class="main-content-inner">
            <div class="breadcrumbs ace-save-state" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li>
                        <i class="ace-icon fa fa-home home-icon"></i>
                        <a href="#">sys</a>
                    </li>
                    <li class="active">index</li>
                </ul><!-- /.breadcrumb -->
            </div>
            <div class="page-content" style="font-size: 15px;font-weight: bold">
                <h4 style="text-align: center;padding: 35px" class="text-gray-800">非道路柴油移动机械检测和车载柴油机排气烟度检验报告</h4>
                <span hidden="hidden" id="reportId"></span>
                <table class="table">
                    <tbody>
                    <tr style="border-top: 2px solid black">
                        <td>检测报告编号：</td>
                        <td colspan="2" contenteditable="true" class="report_content" id="jcbgbh"></td>
                        <td>机械检测日期：</td>
                        <td contenteditable="false" colspan="2">
                            <div class="input-group" style="width: 100%">
                                <input id="jxjcrq" class="form-control" type="text"/>
                                <span class="input-group-addon"><i class="fa fa-calendar bigger-110"></i></span>
                            </div>

                        </td>
                    </tr>

                    <tr>
                        <td>检测机构名称：</td>
                        <td colspan="2" id="jcjgmc">河南政企商务服务有限公司</td>
                        <td>机械机构地址：</td>
                        <td contenteditable="false" class="report_content" colspan="2" id="jxjgdz">南阳市</td>
                    </tr>
                    <tr>
                        <td>检测机构电话：</td>
                        <td colspan="2" id="jcjgdh">0371-56000012</td>
                        <td>检测机构地址：</td>
                        <td contenteditable="false" class="report_content" colspan="2" id="jcjgdz">
                            郑州市郑汴路39号康桥商务广场1120室
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6">一、所有人或代理人信息</td>
                    </tr>
                    <tr>
                        <td>姓名/单位</td>
                        <td colspan="2" contenteditable="true" class="report_content" id="xmdw"></td>
                        <td>联系电话</td>
                        <td contenteditable="true" class="report_content" colspan="2" id="lxdh"></td>
                    </tr>
                    <tr>
                        <td>所有人地址</td>
                        <td contenteditable="true" class="report_content" colspan="5" id="syrdz"></td>
                    </tr>
                    <tr>
                        <td colspan="6">二、非道路柴油移动机械检测和车载柴油机基本信息</td>
                    </tr>
                    <tr>
                        <td>设备生产单位</td>
                        <td contenteditable="true" class="report_content" colspan="5"
                            id="sbscdw"></td>
                    </tr>
                    <tr>
                        <td>发动机制造厂名称</td>
                        <td contenteditable="true" class="report_content" colspan="5"
                            id="fdjzzcmc"></td>
                    </tr>
                    <tr>
                        <td>机械环保号牌</td>
                        <td colspan="2" contenteditable="true" class="report_content"
                            id="jxhbhp"></td>
                        <td>设备牌号</td>
                        <td contenteditable="true" class="report_content" colspan="2" id="sbph"></td>
                    </tr>
                    <tr>
                        <td>机械名称</td>
                        <td colspan="2" contenteditable="true" class="report_content" id="jxmc"></td>
                        <td>商标</td>
                        <td contenteditable="true" class="report_content" colspan="2" id="sb"></td>
                    </tr>
                    <tr>
                        <td>机械型号</td>
                        <td colspan="2" contenteditable="true" class="report_content" id="jxxh"></td>
                        <td>出厂日期</td>
                        <td contenteditable="true" class="report_content" colspan="2" id="ccrq"></td>
                    </tr>
                    <tr>
                        <td>设备颜色</td>
                        <td colspan="2" contenteditable="true" class="report_content" id="sbys"></td>
                        <td>排放部件质保期</td>
                        <td contenteditable="true" class="report_content" colspan="2" id="pfbjzbq"></td>
                    </tr>
                    <tr>
                        <td>检测依据</td>
                        <td colspan="2" id="jcyj" contenteditable="false">GB36886-2018</td>
                        <td>检验方法</td>
                        <td contenteditable="false" class="report_content" colspan="2">
                            <select class="form-control" id="jyff2">
                                <option value="自由加速法">自由加速法</option>
                                <option value="自由加载法">自由加载法</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>机械VIN码</td>
                        <td colspan="2" contenteditable="true" class="report_content" id="jxvinm"></td>
                        <td>发动机编号</td>
                        <td contenteditable="true" class="report_content" colspan="2" id="fdjbh"></td>
                    </tr>
                    <tr>
                        <td>排放阶段</td>
                        <td colspan="2" contenteditable="false" class="report_content" id="pfjd">
                            <input type="radio" name="emissionPeriod" value="I" checked> I &nbsp;
                            <input type="radio" name="emissionPeriod" value="II"> II&nbsp;
                            <input type="radio" name="emissionPeriod" value="III"> III&nbsp;
                            <input type="radio" name="emissionPeriod" value="X"> X&nbsp;
                        </td>
                        <td>发动机型号</td>
                        <td contenteditable="true" class="report_content" colspan="2" id="fdjxh"></td>
                    </tr>
                    <tr>
                        <td>发动机出厂年份</td>
                        <td colspan="2" contenteditable="true" class="report_content" id="fdjccnf"></td>
                        <td>发动机额定功率 (kw)</td>
                        <td contenteditable="true" class="report_content" colspan="2" id="fdjedgl"></td>
                    </tr>
                    <tr>
                        <td>油品</td>
                        <td colspan="2" contenteditable="true" class="report_content" id="yp"></td>
                        <td>发动机额定转速 (r/min)</td>
                        <td contenteditable="true" class="report_content" colspan="2" id="fdjedzs"></td>
                    </tr>
                    <tr>
                        <td>机械类型</td>
                        <td colspan="2" contenteditable="false" class="report_content">
                            <select class="form-control" id="jxlx">
                                <option value="非道路柴油移动机械">非道路柴油移动机械</option>
                                <option value="车载柴油机">车载柴油机</option>
                            </select>
                        </td>
                        <td>检测类型</td>
                        <td contenteditable="false" class="report_content" colspan="2">
                            <select class="form-control" id="jclx">
                                <option value="初检">初检</option>
                                <option value="复检">复检</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>工作特征</td>
                        <td colspan="2" contenteditable="false" class="report_content">
                            <select class="form-control" id="gztx">
                                <option value="恒速">恒速</option>
                                <option value="非恒速">非恒速</option>
                            </select>
                        </td>
                        <td>发动机后处理系统</td>
                        <td contenteditable="false" class="report_content" colspan="2">
                            <select class="form-control" id="fdjhclxt">
                                <option value="无">无</option>
                                <option value="SCR">SCR</option>
                                <option value="DPF">DPF</option>
                                <option value="DOC">DOC</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>属于禁止高排区域</td>
                        <td colspan="2" contenteditable="false" class="report_content">
                            <select class="form-control" id="syjzgpqy">
                                <option value="否">否</option>
                                <option value="是">是</option>
                            </select>
                        </td>
                        <td>驾驶员报警系统</td>
                        <td contenteditable="false" class="report_content" colspan="2">
                            <select class="form-control" id="jsybjxt">
                                <option value="正常">正常</option>
                                <option value="无">无</option>
                                <option value="报警">报警</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>驾驶性能限值系统</td>
                        <td colspan="2" contenteditable="false" class="report_content">
                            <select class="form-control" id="jsxnxzxt">
                                <option value="正常">正常</option>
                                <option value="无">无</option>
                                <option value="报警">报警</option>
                            </select>
                        </td>
                        <td>ECU信息</td>
                        <td contenteditable="false" class="report_content" colspan="2">
                            <select class="form-control" id="ecuxx">
                                <option value="正常">正常</option>
                                <option value="无">无</option>
                                <option value="报警">报警</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>远程监控系统</td>
                        <td colspan="2" contenteditable="false" class="report_content">
                            <select class="form-control" id="ycjkxt">
                                <option value="正常">正常</option>
                                <option value="无">无</option>
                                <option value="不正常">不正常</option>
                            </select>
                        </td>
                        <td>卫星定位系统</td>
                        <td contenteditable="false" class="report_content" colspan="2">
                            <select class="form-control" id="wxdwxt">
                                <option value="正常">正常</option>
                                <option value="无">无</option>
                                <option value="不正常">不正常</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6">三、检测环境</td>
                    </tr>
                    <tr>
                        <td>环境温度℃</td>
                        <td colspan="2" contenteditable="true" class="report_content" id="hjwd"></td>
                        <td>海拔高度 (m)</td>
                        <td contenteditable="true" class="report_content" colspan="2" id="hbgd"></td>
                    </tr>
                    <tr>
                        <td>环境湿度（%）</td>
                        <td colspan="2" contenteditable="true" class="report_content" id="hjsd"></td>
                        <td>大气压力 (kPa)</td>
                        <td contenteditable="true" class="report_content" colspan="2" id="dqyl"></td>
                    </tr>
                    <tr>
                        <td colspan="6">四、检测设备信息</td>
                    </tr>
                    <tr>
                        <td>设备名称</td>
                        <td colspan="2">型号/规格</td>
                        <td>出厂编号</td>
                        <td colspan="2">设备计量证书</td>
                    </tr>
                    <tr>
                        <td id="sbmc" contenteditable="false" class="report_content">不透光烟度计</td>
                        <td colspan="2" contenteditable="true" class="report_content" id="xhgg"></td>
                        <td contenteditable="true" class="report_content" id="ccbh"></td>
                        <td contenteditable="true" class="report_content" colspan="2"
                            id="sbjlzs"></td>
                    </tr>
                    <tr>
                        <td id="sbmc2" contenteditable="false" class="report_content">转速仪</td>
                        <td colspan="2" contenteditable="true" class="report_content" id="xhgg2"></td>
                        <td contenteditable="true" class="report_content" id="ccbh2"></td>
                        <td contenteditable="true" class="report_content" colspan="2"
                            id="sbjlzs2"></td>
                    </tr>
                    <tr>
                        <td colspan="6">五、检验结果/地理位置</td>
                    </tr>
                    <tr>
                        <td>依据标准：</td>
                        <td colspan="2" id="yjbz" contenteditable="false">非道路柴油移动机械排气<br>烟度限值及测量方法(不透光烟度法)<br>GB36886-2018</td>
                        <td>检验方法：</td>
                        <td contenteditable="false" class="report_content" colspan="2">
                            <select class="form-control" id="jyff">
                                <option value="自由加速法">自由加速法</option>
                                <option value="自由加载法">自由加载法</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>检测开始时间/24h</td>
                        <td contenteditable="true" class="report_content" id="jckssj"></td>
                        <td>检测结束时间/24h</td>
                        <td contenteditable="true" class="report_content" id="jcjssj"></td>
                        <td>检测地点 (经纬度)</td>
                        <td contenteditable="true" class="report_content" id="jcdd"></td>
                    </tr>
                    <tr>
                        <td rowspan="2">检测过程</td>
                        <td>第一次(m-¹)</td>
                        <td>第二次(m-¹)</td>
                        <td>第三次(m-¹)</td>
                        <td>发动机转速(r/min)</td>
                        <td>目视烟羽</td>
                    </tr>
                    <tr>
                        <td contenteditable="true" class="report_content" id="jcjg1"></td>
                        <td contenteditable="true" class="report_content" id="jcjg2"></td>
                        <td contenteditable="true" class="report_content" id="jcjg3"></td>
                        <td contenteditable="true" class="report_content" id="fdjzs"></td>
                        <td contenteditable="false" class="report_content" colspan="2" id="msyy">
                            <input type="radio" name="msyy" value="0" checked> 不可见 &nbsp;
                            <input type="radio" name="msyy" value="1"> 可见 &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>检测结果</td>
                        <td contenteditable="true" class="report_content" colspan="4" id="jcjg"></td>
                        <td>自由加速三次检测结果<br>平均值(m-¹)/自由加载<br>三次结果最大值(m-¹)</td>
                    </tr>
                    <tr>
                        <td>排放限值(m-¹)</td>
                        <td contenteditable="true" class="report_content" colspan="5" id="pfxz">
                        </td>
                    </tr>
                    <tr>
                        <td>结果判定</td>
                        <td contenteditable="false" class="report_content" colspan="5" id="jgpd"></td>
                    </tr>
                    <tr>
                        <td colspan="6">六、检测过程照片</td>
                    </tr>
                    <tr>
                        <td colspan="3">机械整体照片</td>
                        <td colspan="3">车辆铭牌照片</td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <input id="jxztzp" type="file" accept="image/*">
                        </td>
                        <td colspan="3">
                            <input id="clmpzp" type="file" accept="image/*">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">发动机铭牌照片</td>
                        <td colspan="3">后处理装置照片</td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <input id="fdjmpzp" type="file" accept="image/*">
                        </td>
                        <td colspan="3">
                            <input id="hclzzzp" type="file" accept="image/*">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">检测照片</td>
                        <td colspan="3">结果照片</td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <input id="jczp" type="file" accept="image/*">
                        </td>
                        <td colspan="3">
                            <input id="jgzp" type="file" accept="image/*">
                        </td>
                    </tr>
                    </tbody>
                </table>
                <div class="table_foot">
                    <!--                        <span>报告编制</span><img th:src="@{/img/bz.png}">-->
                    <!--                        <span>审核</span><img th:src="@{/img/bz.png}">-->
                    <!--                        <span>批准</span><img th:src="@{/img/bz.png}">-->
                    <!--                        <p>1、本公司检测报告须同时具有检验检测专用章及资质认定标志，骑缝章及资质认定标志,缺少其中之一则报告无效。</p>-->
                    <!--                        <p>2、结果表述清晰，易于理解，无授权签字人签字识别的报告无效。</p>-->
                    <!--                        <p>3、本检验报告仅对受检机械检验时的状态负责，由委托单位自行采集的样品，仅对送检样品监测数据负责，不对样品来源负责，无法复现的样品，不受理申诉。</p>-->
                    <!--                        <p>4、当需要对检测报告做出意见和解释时，本公司依据评审准则将意见和解释在报告中清晰标注。</p>-->
                    <a id="save_report" href="#" class="btn btn-primary btn-icon-split right">
                        <span class="text">保存本地</span>
                    </a>
                    <a id="submit_report" href="#" class="btn btn-success btn-icon-split align-right">
                        <span class="text">提交审核</span>
                    </a>
                </div>
            </div>
        </div><!-- /.page-content -->
    </div>
</div><!-- /.main-content -->

<div class="footer">
    <div class="footer-inner">
        <div class="footer-content">
                <span class="bigger-120">
                    <span class="blue bolder">公里派</span>
                    后台管理系统 &copy; 2020
                </span>
        </div>
    </div>
</div>

<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
    <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
</a>
</div><!-- /.main-container -->
<script th:src="@{/js/jquery-2.1.4.min.js}"></script>
<!--<script th:src="@{/js/jquery-1.11.3.min.js}"></script>-->
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/js/ace-elements.min.js}"></script>
<script th:src="@{/js/ace.min.js}"></script>
<script th:src="@{/js/bootstrap-fileinput.js}"></script>
<script th:src="@{/js/bootstrap-datepicker.min.js}"></script>
<script th:src="@{/js/locales/bootstrap-datepicker.zh-CN.min.js}"></script>
</body>
<script>
    $("#jxjcrq").datepicker({
        language: 'zh-CN',
        autoclose: true,
        format: 'yyyy.mm.dd'
    });
</script>
<script>
    $("#jyff2").val($("#jyff").val());
    $("#jyff").change(function () {
        $("#jyff2").val($(this).val());
        zy_value();
    });
    $("#jyff2").change(function () {
        $("#jyff").val($(this).val());
        zy_value();
    });
    $("#jcjg1").blur(function () {
        zy_value();
    });
    $("#jcjg2").blur(function () {
        zy_value();
    });
    $("#jcjg3").blur(function () {
        zy_value();
    });

    function zy_value() {
        var res1 = $("#jcjg1").text().trim();
        var res2 = $("#jcjg2").text().trim();
        var res3 = $("#jcjg3").text().trim();
        var result = 0;
        console.log(res1 + "," + res2 + "," + res3)
        if (res1 != "" && res2 != "" && res3 != "") {
            if ("自由加速法" == $("#jyff").val()) {
                var fix = Math.max(res1.substring(res1.indexOf(".") + 1).length, res2.substring(res2.indexOf(".") + 1).length, res3.substring(res3.indexOf(".") + 1).length);
                fix = fix < 2 ? 2 : fix;
                result = ((Number(res1) + Number(res2) + Number(res3)) / 3).toFixed(fix);
            } else {
                result = Math.max(Number(res1), Number(res2), Number(res3));
            }
            $("#jcjg").text(result);
        } else {
            $("#jcjg").text("");
        }
        //-----start 合格判定
        hg();
        //-----end 合格判定
    }

    $("#syjzgpqy").change(function () {
        limits();
        //-----start 合格判定
        hg();
        //-----end 合格判定
    });

    function limits() {
        var bnr = $("#syjzgpqy").val();
        var power = Number($("#fdjedgl").text().trim());
        var period = $("#pfjd input:radio:checked").val();
        var result = "";
        if (bnr == "是") {
            if (power < 37) {
                result = "0.80";
            } else {
                result = "0.50";
            }
            $("#pfxz").text(result);
        } else {
            $("#pfxz").text(xz(period, power));
        }
    }

    $("#fdjedgl").blur(function () {
        var period = $("#pfjd input:radio:checked").val();
        var result;
        var power = Number($("#fdjedgl").text().trim());
        if ($("#syjzgpqy").val() == "是") {
            limits();
            hg();
            return false;
        }
        if (power != "") {
            $("#pfxz").text(xz(period, power));
        } else {
            $("#pfxz").text("");
        }
        //-----start 合格判定
        hg();
        //-----end 合格判定
    });
    $("#pfjd :radio").on("click", function () {
        var period = $(this).val();
        var power = Number($("#fdjedgl").text().trim());
        if (power != "") {
            $("#pfxz").text(xz(period, power));
        } else {
            $("#pfxz").text("");
        }
        //-----start 合格判定
        hg();
        //-----end 合格判定
    });

    function xz(period, power) {
        var result;
        if (period == "I" || period == "II") {
            if (power < 19) {
                result = "3.00";
            } else if (power < 37) {
                result = "2.00";
            } else if (power <= 560) {
                result = "1.61";
            }
        } else if (period == "III") {
            if (power < 19) {
                result = "2.00";
            } else if (power < 37) {
                result = "1.00";
            } else {
                result = "0.80";
            }
        } else if (period == "X") {
            if (power < 37) {
                result = "0.80";
            } else {
                result = "0.50";
            }
        } else {
            result = "";
        }
        return result;
    }

    $("#msyy :radio").on("click", function () {
        hg();
    });

    function hg() {
        var limit = $("#pfxz").text().trim();
        var result = $("#jcjg").text().trim();
        var vp = $("#msyy input:radio:checked").val();
        var period = $("#pfjd input:radio:checked").val();
        var power = Number($("#fdjedgl").text().trim());
        var temp = "合格";
        if (limit != "" && result != "") {
            if (result > limit) {
                temp = "不合格";
            } else {
                if (vp == 1) {
                    if (period == "II" && power >= 19) {
                        temp = "不合格";
                    } else if (period == "III") {
                        temp = "不合格";
                    }
                }
            }
            $("#jgpd").text(temp);
        } else {
            $("#jgpd").text("");
        }
    }


    var zp_map = {};  //存图片的base64 map对象
    $("[type='file']").change(function () {
        var file = this.files[0];
        var key = this.id;
        if (file == null) {
            delete zp_map[key];
            return;
        }
        var reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = function (e) {
            zp_map[key] = this.result;
        }
    });

    /**
     * 数据装载
     * @returns {string}
     */
    function data_load() {
        var data = JSON.stringify({
            reportId: $("#reportId").text(),
            jcbgbh: $("#jcbgbh").text().trim(),
            jxjcrq: $("#jxjcrq").val(),
            jcjgmc: $("#jcjgmc").text(),
            jxjgdz: $("#jxjgdz").text(),
            jcjgdh: $("#jcjgdh").text().trim(),
            jcjgdz: $("#jcjgdz").text().trim(),
            xmdw: $("#xmdw").text().trim(),
            lxdh: $("#lxdh").text().trim(),
            syrdz: $("#syrdz").text().trim(),
            sbscdw: $("#sbscdw").text().trim(),
            fdjzzcmc: $("#fdjzzcmc").text().trim(),
            jxhbhp: $("#jxhbhp").text().trim(),
            sbph: $("#sbph").text().trim(),
            jxmc: $("#jxmc").text().trim(),
            sb: $("#sb").text().trim(),
            jxxh: $("#jxxh").text().trim(),
            ccrq: $("#ccrq").text().trim(),
            sbys: $("#sbys").text().trim(),
            pfbjzbq: $("#pfbjzbq").text().trim(),
            jcyj: $("#jcyj").text().trim(),
            jxvinm: $("#jxvinm").text().trim(),
            fdjbh: $("#fdjbh").text().trim(),
            pfjd: $("#pfjd input:radio:checked").val(),  //因为是radio 获取radio
            fdjxh: $("#fdjxh").text().trim(),
            fdjccnf: $("#fdjccnf").text().trim(),
            fdjedgl: $("#fdjedgl").text().trim(),
            yp: $("#yp").text().trim(),
            fdjedzs: $("#fdjedzs").text().trim(),
            jxlx: $("#jxlx").val(),
            jclx: $("#jclx").val(),
            gztx: $("#gztx").val(),
            fdjhclxt: $("#fdjhclxt").val(),
            syjzgpqy: $("#syjzgpqy").val(),
            jsybjxt: $("#jsybjxt").val(),
            jsxnxzxt: $("#jsxnxzxt").val(),
            ecuxx: $("#ecuxx").val(),
            ycjkxt: $("#ycjkxt").val(),
            wxdwxt: $("#wxdwxt").val(),
            hjwd: $("#hjwd").text().trim(),
            hbgd: $("#hbgd").text().trim(),
            hjsd: $("#hjsd").text().trim(),
            dqyl: $("#dqyl").text().trim(),
            sbmc: $("#sbmc").text().trim(),
            xhgg: $("#xhgg").text().trim(),
            ccbh: $("#ccbh").text().trim(),
            sbjlzs: $("#sbjlzs").text().trim(),
            sbmc2: $("#sbmc2").text().trim(),
            xhgg2: $("#xhgg2").text().trim(),
            ccbh2: $("#ccbh2").text().trim(),
            sbjlzs2: $("#sbjlzs2").text().trim(),
            yjbz: $("#yjbz").text().trim(),
            jyff: $("#jyff").val(),
            jckssj: $("#jckssj").text().trim(),
            jcjssj: $("#jcjssj").text().trim(),
            jcdd: $("#jcdd").text().trim(),
            jcjg1: $("#jcjg1").text().trim(),
            jcjg2: $("#jcjg2").text().trim(),
            jcjg3: $("#jcjg3").text().trim(),
            fdjzs: $("#fdjzs").text().trim(),
            msyy: $("#msyy input:radio:checked").val(),
            jcjg: $("#jcjg").text().trim(),
            pfxz: $("#pfxz").text().trim(),
            jgpd: $("#jgpd").text().trim(),
            jxztzp: zp_map["jxztzp"],
            clmpzp: zp_map["clmpzp"],
            fdjmpzp: zp_map["fdjmpzp"],
            hclzzzp: zp_map["hclzzzp"],
            jczp: zp_map["jczp"],
            jgzp: zp_map["jgzp"]
        });
        return data;
    }

    $("#save_report").click(function () {
        var data = data_load();
        console.log(data);
        $.ajax({
            url: "/report/save",
            type: "post",
            contentType: "application/json;charset=utf-8",
            data: data,
            success: function (result) {
                alert(result.message);
                if (result.code != 500) {
                    // window.location.href = "/report/submit-view?reportId=" + result.data;
                }
            }
        });
    });

    $("#submit_report").click(function () {
        if (confirm("报告提交后将会变成待审核状态，确认提交吗？请确认检查是否有不完整数据！")) {
            var data = data_load();
            $.ajax({
                url: "/report/submit",
                type: "post",
                contentType: "application/json;charset=utf-8",
                data: data,
                success: function (result) {
                    alert(result.message);
                    if (result.code != 500) {
                        window.location.href= "/report/submit-view ";
                        // window.location.href = "/report/submit-view?reportId=" + result.data;
                    }
                }
            });
        };
    })
</script>
<script th:inline="javascript">
    if ([[${report?.reportId}]] != null) {
        $("#reportId").text([[${report?.reportId}]]);
        $("#jcbgbh").text([[${report?.jcbgbh}]]);
        $("#jxjcrq").val([[${report?.jxjcrq}]]);
        $("#xmdw").text([[${report?.xmdw}]]);
        $("#lxdh").text([[${report?.lxdh}]]);
        $("#syrdz").text([[${report?.syrdz}]]);
        $("#sbscdw").text([[${report?.sbscdw}]]);
        $("#fdjzzcmc").text([[${report?.fdjzzcmc}]]);
        $("#jxhbhp").text([[${report?.jxhbhp}]]);
        $("#sbph").text([[${report?.sbph}]]);
        $("#jxmc").text([[${report?.jxmc}]]);
        $("#sb").text([[${report?.sb}]]);
        $("#jxxh").text([[${report?.jxxh}]]);
        $("#ccrq").text([[${report?.ccrq}]]);
        $("#sbys").text([[${report?.sbys}]]);
        $("#pfbjzbq").text([[${report?.pfbjzbq}]]);
        $("#jcyj").text([[${report?.jcyj}]]);
        $("#jxvinm").text([[${report?.jxvinm}]]);
        $("#fdjbh").text([[${report?.fdjbh}]]);
        $("#pfjd input[value="+[[${report?.pfjd}]]+"]").prop("checked", "checked");
        $("#fdjxh").text([[${report?.fdjxh}]]);
        $("#fdjccnf").text([[${report?.fdjccnf}]]);
        $("#fdjedgl").text([[${report?.fdjedgl}]]);
        $("#yp").text([[${report?.yp}]]);
        $("#fdjedzs").text([[${report?.fdjedzs}]]);
        $("#jxlx").val([[${report?.jxlx}]]).attr("selected", "true");
        $("#jclx").val([[${report?.jclx}]]).attr("selected", "true");
        $("#gztx").val([[${report?.gztx}]]).attr("selected", "true");
        $("#fdjhclxt").val([[${report?.fdjhclxt}]]).attr("selected", "true");
        $("#syjzgpqy").val([[${report?.syjzgpqy}]]).attr("selected", "true");
        $("#jsybjxt").val([[${report?.jsybjxt}]]).attr("selected", "true");
        $("#jsxnxzxt").val([[${report?.jsxnxzxt}]]).attr("selected", "true");
        $("#ecuxx").val([[${report?.ecuxx}]]).attr("selected", "true");
        $("#ycjkxt").val([[${report?.ycjkxt}]]).attr("selected", "true");
        $("#wxdwxt").val([[${report?.wxdwxt}]]).attr("selected", "true");
        $("#hjwd").text([[${report?.hjwd}]]);
        $("#hbgd").text([[${report?.hbgd}]]);
        $("#hjsd").text([[${report?.hjsd}]]);
        $("#dqyl").text([[${report?.dqyl}]]);
        $("#sbmc").text([[${report?.sbmc}]]);
        $("#xhgg").text([[${report?.xhgg}]]);
        $("#ccbh").text([[${report?.ccbh}]]);
        $("#sbjlzs").text([[${report?.sbjlzs}]]);
        $("#sbmc2").text([[${report?.sbmc2}]]);
        $("#xhgg2").text([[${report?.xhgg2}]]);
        $("#ccbh2").text([[${report?.ccbh2}]]);
        $("#sbjlzs2").text([[${report?.sbjlzs2}]]);
        // $("#yjbz").text([[${report?.yjbz}]]);
        $("#jyff").val([[${report?.jyff}]]);
        $("#jckssj").text([[${report?.jckssj}]]);
        $("#jcjssj").text([[${report?.jcjssj}]]);
        $("#jcdd").text([[${report?.jcdd}]]);
        $("#jcjg1").text([[${report?.jcjg1}]]);
        $("#jcjg2").text([[${report?.jcjg2}]]);
        $("#jcjg3").text([[${report?.jcjg3}]]);
        $("#fdjzs").text([[${report?.fdjzs}]]);
        $("#msyy input[value=" + [[${report?.msyy}]] + "]").prop("checked", "checked");
        $("#jcjg").text([[${report?.jcjg}]]);
        $("#pfxz").text([[${report?.pfxz}]]);
        $("#jgpd").text([[${report?.jgpd}]]);
        zp_map["jxztzp"] = [[${report?.jxztzp}]];
        zp_map["clmpzp"] = [[${report?.clmpzp}]];
        zp_map["fdjmpzp"] = [[${report?.fdjmpzp}]];
        zp_map["hclzzzp"] = [[${report?.hclzzzp}]];
        zp_map["jczp"] = [[${report?.jczp}]];
        zp_map["jgzp"] = [[${report?.jgzp}]];
    }
    image_load("jxztzp");
    image_load("clmpzp");
    image_load("fdjmpzp");
    image_load("hclzzzp");
    image_load("jczp");
    image_load("jgzp");

    function image_load(zpId) {
        if ("" == zp_map[zpId] || null == zp_map[zpId]) {
            $("#" + zpId).fileinput({
                language: "zh", //设置语言
                allowedFileExtensions: ["jpg", "png", "gif"],//接收的文件后缀,
                maxFileCount: 1,
                enctype: "multipart/form-data",
                maxFileSize: 2048,   //设置文件最大不超过 2M
                showCaption: true,//是否显示标题
                showUpload: false,  //不显示上传按钮
                browseClass: "btn btn-primary", //按钮样式
            });
        } else {
            $("#" + zpId).fileinput({
                language: "zh", //设置语言
                allowedFileExtensions: ["jpg", "png", "gif"],//接收的文件后缀,
                maxFileCount: 1,
                enctype: "multipart/form-data",
                maxFileSize: 2048,   //设置文件最大不超过 2M
                showCaption: true,//是否显示标题
                showUpload: false,  //不显示上传按钮
                browseClass: "btn btn-primary", //按钮样式
                initialPreview: [
                    "<img src=" + zp_map[zpId] + " class='file-preview-image' title='jpg' alt='jpg' style='width:auto;height:160px;'>"
                ]
            });
        }
    }
</script>
</html>

<!--jcbgbh-->
<!--jxjcrq-->
<!--jcjgmc-->
<!--jxjgdz-->
<!--jcjgdh-->
<!--jcjgdz-->
<!--xmdw-->
<!--lxdh-->
<!--syrdz-->
<!--sbscdw-->
<!--fdjzzcmc-->
<!--jxhbhp-->
<!--sbph-->
<!--jxmc-->
<!--sb-->
<!--jxxh-->
<!--ccrq-->
<!--sbys-->
<!--pfbjzbq-->
<!--jcyj-->
<!--jxvinm-->
<!--fdjbh-->
<!--pfjd-->
<!--fdjxh-->
<!--fdjccnf-->
<!--fdjedgl-->
<!--yp-->
<!--fdjedzs-->
<!--jxlx-->
<!--jclx-->
<!--gztx-->
<!--fdjhclxt-->
<!--syjzgpqy-->
<!--jsybjxt-->
<!--jsxnxzxt-->
<!--ecuxx-->
<!--ycjkxt-->
<!--wxdwxt-->
<!--hjwd-->
<!--hbgd-->
<!--hjsd-->
<!--dqyl-->
<!--sbmc-->
<!--xhgg-->
<!--ccbh-->
<!--sbjlzs-->
<!--sbmc2-->
<!--xhgg2-->
<!--ccbh2-->
<!--sbjlzs2-->
<!--yjbz-->
<!--jyff-->
<!--jckssj-->
<!--jcjssj-->
<!--jcdd-->
<!--jcjg1-->
<!--jcjg2-->
<!--jcjg3-->
<!--fdjzs-->
<!--msyy-->
<!--jcjg-->
<!--pfxz-->
<!--jgpd-->
<!--jxztzp-->
<!--clmpzp-->
<!--fdjmpzp-->
<!--hclzzzp-->
<!--jczp-->
<!--jgzp-->